package com.xd.core.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.xd.core.business.dto.OutInfoAppQuery;
import com.xd.core.business.dto.OutInfoQuery;
import com.xd.core.business.entity.OutInfo;
import com.xd.core.business.vo.*;
import com.xd.core.company.dto.HomeQueryDto;
import com.xd.core.company.vo.OutCounts;
import com.xd.core.finance.dto.LendingRecordQueryDto;
import com.xd.core.finance.vo.LendingRecordQueryVo;
import com.xd.core.openapi.vo.OutDetailVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 放款表 Mapper 接口
 * </p>
 *
 * @author ZX
 * @since 2025-02-27
 */
public interface OutInfoMapper extends BaseMapper<OutInfo> {

    List<OutInfoPageVo> getList(@Param("query") OutInfoQuery query,
                                @Param("ids") List<Integer> ids,
                                @Param("companyId") Integer companyId,
                                @Param("companyType") String companyType);

    OutInfoVo getDetail(Integer id);

    Page<LendingRecordQueryVo> getLendingRecords(@Param("dto") LendingRecordQueryDto dto,@Param("userIds") List<Integer> userIds , @Param("companyId") Integer companyId);

    Integer selectOutCounts(List<Integer> agencyCounts);

    OutCounts getOutCounts(@Param("query") HomeQueryDto query,
                           @Param("companyId") Integer companyId,
                           @Param("type") String type);

    void updateStatus(@Param("status") String status, @Param("outId") Integer outId);

    List<OutIdTime> selectIdTimes(Integer id);

    List<OutInsuranceInfoPageVo> outInsuranceInfoList(@Param("query") OutInfoQuery query,
                                                      @Param("ids") List<Integer> ids,
                                                      @Param("companyId") Integer companyId,
                                                      @Param("companyType") String companyType);

    OutInsuranceInfoVo getInsuranceIncomingDetail(Integer id);

    void updateAdvanceStatus(Integer incomingId);

    void updateClearDate(Integer outId);

    String getPayPassByOutId(Integer outId);

    List<String> getPayPass(@Param("outIds") List<Integer> outIds);

    OutDetailVo selectOutDetail(Integer incomingId);

    List<OutInfoPageAppVo> outInfoAppList(@Param("query") OutInfoAppQuery query,
                                          @Param("userIds") List<Integer> userIds,
                                          @Param("companyId") Integer companyId,
                                          @Param("companyType") String companyType);

    OutInfoAppVo outInfoAppDetail(Integer incomingId);

    String getLoanMethod(Integer incomingId);

    void updateRate(BigDecimal newRate, Integer outId);
}
